#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
	FILE* p1 = fopen("reai.txt", "r");
	if (p1 == NULL)
	{
		perror("fopen");
		exit(0);
	}
	FILE* p2 = fopen("reai_copy.txt", "w");
	if (p2 == NULL)
	{
		fclose(p1);
		perror("fopen");
		exit(0);
	}
	int ch = 0;
	while (ch = fgetc(p1) != EOF)
	{
		fputc(ch, p2);
	}
	fclose(p1);
	fclose(p2);
	p1 = NULL;
	p2 = NULL;
	return 0;
}